package com.wm.blog_admin.controller;

import com.wm.blog_admin.controller.base.AdminBaseController;
import com.wm.blog_common.util.DateUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * @author ：半卷流年
 * @description : ${description}
 * @createTime ：2020/5/4
 */
@Controller
@RequestMapping("/test")
public class TestThyController extends AdminBaseController {

    @RequestMapping("/success")
    public String success(Model model, HttpServletRequest request){
        String authorization = super.currentAuthorization(request);
        Date now = DateUtil.getCurrentDate();
        String s = DateUtil.formatterLocalDateTimeToString(now, "yyyy-MM-dd HH:mm:ss");
        //前缀：classpath:/templates/ success  后缀.html
        model.addAttribute("userName","admin");
        model.addAttribute("superEmail","2222222@qq.com");
        model.addAttribute("password","123");
        model.addAttribute("email","2121212@qq.com");
        model.addAttribute("registTime",s);
        model.addAttribute("ip","127.0.0.1");
        model.addAttribute("currentTime",s);
        model.addAttribute("id",1L);
        model.addAttribute("url","http://localhost:9093/blog/admin/activeAccount");
        model.addAttribute("addresss","广东省深圳市");
        model.addAttribute("Authorization",authorization);

        return "activeAccount";
    }

}
